package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("image.jpg");
        FileOutputStream fos = new FileOutputStream("image5.jpg");
        byte[] bytes = new byte[1024*10];
        int d;
        while ((d = fis.read(bytes)) != -1){
            fos.write(bytes,0,d);
        }
        fis.close();
        fos.close();
        long end = System.currentTimeMillis();
        System.out.println(end-start);

    }
}
